#!/bin/bash
set -e

function info() {
echo Usage: `basename $0` '[-p out_prefix]'

cat <<info
info
exit 65
}

function error() {
echo `basename $0`': invalid option --'
echo Usage: `basename $0` '[-p out_prefix]'

cat <<error
error
exit 65
}

while getopts ":p:h" opts
do
case $opts in
p) out_prefix=$OPTARG;;
h) info;;
\?) error;;
esac
done
shift $(($OPTIND - 1))


#-----------------------------------------------
. /mnt/ilustre/app/medical/tools/.var #---------
#-----------------------------------------------


# for i in $(seq 100); do
# echo $i.cn_simu.txt cn_simu 1 $out_prefix > $out_prefix.cn_simu.name.txt

# Rscript ${tools_path}/script/lorenz_cnv.r --args $out_prefix.simu_cn.name.txt
# mv 1.lorenz.pdf $i.lorenz.simu_cn.pdf
# rm $i.cn_simu.txt

# pdfs="$pdfs $i.lorenz.simu_cn.pdf"
# done

# run.sh cpdf -merge $pdfs -o $out_prefix.lorenz.cn_simu.pdf

# rm *.lorenz.simu_cn.pdf

# bak.sh -ttes $out_prefix.cn_states_simu.pdf $out_prefix.lorenz.cn_simu.pdf

cp $tools_path/matlab/simu_cn0115.m .
matlab -nojvm -r "simu_cn0115; quit;"

rm simu_cn0115.m



